﻿using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;

namespace ERP.ERPSystem.ProductionSystem.Dto
{
    /// <summary>
    /// 工艺流程的数据传输对象 (DTO)，用于在各层之间传递工艺数据。
    /// </summary>
    public class WorkmanshipDTO : EntityDto<int>
    {
        /// <summary>
        /// 工艺路线编号
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string WorkmanshipCode { get; set; }
    
        /// <summary>
        /// 工艺路线名称
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string WorkmanshipName { get; set; }

        /// <summary>
        /// 工艺路线说明
        /// </summary>
        [MaxLength(50)]
        public string WorkmanshipDescribe { get; set; }

        /// <summary>
        /// 是否启用(1=启用，0=禁用)
        /// </summary>
        public int? IsNo { get; set; }

        /// <summary>
        /// 备注信息
        /// </summary>
        [MaxLength(50)]
        public string Context { get; set; }
    }

    /// <summary>
    /// 用于创建或更新工艺流程的 DTO
    /// </summary>
    public class CreateUpdateWorkmanshipDto
    {
        /// <summary>
        /// 工艺路线编号
        /// </summary>
        [MaxLength(50)]
        public string WorkmanshipCode { get; set; }

        /// <summary>
        /// 工艺路线名称
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string WorkmanshipName { get; set; }

        /// <summary>
        /// 工艺路线说明
        /// </summary>
        [MaxLength(50)]
        public string WorkmanshipDescribe { get; set; }

        /// <summary>
        /// 是否启用(1=启用，0=禁用)
        /// </summary>
        public int? IsNo { get; set; }

        /// <summary>
        /// 备注信息
        /// </summary>
        [MaxLength(50)]
        public string Context { get; set; }
        
        /// <summary>
        /// 是否自动生成编号
        /// </summary>
        public bool AutoGenerateCode { get; set; }
    }

    /// <summary>
    /// 用于查询工艺流程的输入 DTO，包含筛选和分页信息。
    /// </summary>
    public class GetWorkmanshipInputDto : PagedAndSortedResultRequestDto
    {
        /// <summary>
        /// (筛选条件) 工艺路线编号
        /// </summary>
        public string? WorkmanshipCode { get; set; }
        /// <summary>
        /// (筛选条件) 工艺路线名称
        /// </summary>
        public string? WorkmanshipName { get; set; }
        /// <summary>
        /// (筛选条件) 是否启用
        /// </summary>
        public int? IsNo { get; set; }
    }
}
